<?php
require_once('db.php');

$id = $_POST['id'];
$data = array();
$result = fetchAll('products',"`parent_id`='$id'","`id`,`name`");
while($ans = mysql_fetch_assoc($result)) {
  $data[] = $ans;
}

echo json_encode($data);
